package com.huawei.appmarket.service.externalapi.actions;

import android.content.ActivityNotFoundException;
import android.content.Intent;
import o.cjm;
import o.Logger;
import o.dyr;
import o.dys.a;

public class ShowGameServiceAuthAppsAction extends dyr {
    private static final int GAMESERVICE_REQUEST_CODE = 3000;
    private static final String TAG = "ShowGameServiceAuthAppsAction";

    public ShowGameServiceAuthAppsAction(a aVar) {
        super(aVar);
    }

    public void onAction() {
        try {
            this.callback.ˋ(new cjm("gameservice.authapps.activity", null), GAMESERVICE_REQUEST_CODE);
        } catch (ActivityNotFoundException e) {
            Logger.ˋ(TAG, "ActivityNotFoundException :" + e.toString());
        }
    }

    public void onActivityResult(int i, int i2, Intent intent) {
        Logger.ˎ(TAG, "onActivityResult: requestCode:" + i + " resultCode:" + i2);
        if (this.callback == null) {
            Logger.ˋ(TAG, "invalid callback");
        } else if (i == GAMESERVICE_REQUEST_CODE) {
            this.callback.setResult(i2, intent);
            this.callback.finish();
        }
    }
}
